[20250218] BOJ / 골드4 / 키 순서 / 설진영 #140
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/2458
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
학생들의 키 대소 관계가 주어지면, 등수가 확정되는 학생 수를 구해보자.
🔍 풀이 방법
BFS로 방향 그래프의 각 노드에 대해 방문할 수 있는 노드들을 모두 찾고,
[내가 갈 수 있는 노드] U [나에게 올 수 있는 노드] = [자신을 제외한 모든 노드]
인 노드들의 개수를 구한다.
⏳ 회고
플루이드 와샬로 풀면 더 나을듯?